<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" id="num1"/>
		<select id="s1">
			<option value ="+">+</option>
			<option value ="-">-</option>
			<option value ="*">*</option>
			<option value ="/">/</option>
		</select>
		<input type="text" id="num2"/>
		结果：
		<input type="text" id="num3"/>
		<button type="button" onclick="aa()">计算</button>
	</body>
	<script type="text/javascript">
		function aa(){
			var a = document.getElementById('s1').value;
			var n = document.getElementById('num1').value;
			var m = document.getElementById('num2').value;
			if(a=='+'){
				var b = parseFloat(n) + parseFloat(m) ;
				document.getElementById('num3').value = b.toFixed(6) ;
			}
			else if(a=='-'){
				var b = parseFloat(n) - parseFloat(m) ;
				document.getElementById('num3').value = b.toFixed(6) ;
			}
			else if(a=='*'){
				var b = parseFloat(n) * parseFloat(m) ;
				document.getElementById('num3').value = b.toFixed(6) ;
			}
			else if(a=='/'){
				var b = parseFloat(n) / parseFloat(m) ;
				document.getElementById('num3').value = b.toFixed(6) ;
			}
		}
	</script>
</html>
